EncontrarAmigos::Application.routes.draw do

  # To login with omniauth
  match '/auth/:provider/callback' => 'acceder#create'

  # aliases:
  get '/' => 'acceder#index'
  get '/logout' => 'acceder#logout'
  get '/error_explanation' => 'acceder#error_explanation'
  get '/preferencias' => 'acceder#preferencias'

  # users:
  get '/me' => 'users#my_information'
  get '/users/:id' => 'users#show'

  resources 'acceder' do
    collection do
      get 'index'
      get 'create'
      get 'logout'
    end
  end

  resources 'map' do
    collection do
      get 'index'
    end
  end

  # friendships:
  post '/friendship/:id' => 'friendship#create'
  post '/friendship/:id/destroy' => 'friendship#destroy'

  root :to => 'acceder#index'

  match '*a', :to => 'acceder#routing_error'
end